package com.dao.impl;

import java.util.List;

import com.base.BaseDao;
import com.dao.NewUserDao;
import com.entity.NewUser;
import com.exception.DaoException;

public class NewUserDaoImpl extends BaseDao<NewUser> implements NewUserDao {

	@Override
	public NewUser login(String uname, String upwd) throws DaoException {

		List<NewUser> users = executeQuery("select * from news_users where uname = ? and upwd = ?", uname, upwd);
		if (users == null || users.size() == 0) {
			return null;
		}

		return users.get(0);
	}

}
